<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的收藏 - 爽客网</title>
<%@include file="../common/js.jsp" %>
<%@include file="../common/css.jsp" %>
<link href="/css/base/hf.css" type="text/css" rel="stylesheet" />
<link href="/css/other.css" type="text/css" rel="stylesheet" />
<link href="css/pager.css" type="text/css" rel="stylesheet" />
</head>
<body>

 <!-- head -->
	<%@include file="../common/header.jsp" %>
	<!-- header-->
	<div class="wrap">
    	<div class="w965 mg i_main_box">
        	<!-- left -->
           <%@include file="myLeft.jsp" %>
            <!-- left--end-->
             <div class="i_right_box" style="height:1500px;">
            	<div class="collect_box">
                	<h1>我的收藏</h1>
                    <!-- order-->
                    <div class="mb10">
                        <table class="collect_detail">
                            <tr class="row1">
                                <td width="50">收藏号</td>
                                <td width="400">收藏对象</td>
                                <td width="55">收藏种类</td>
                                <td width="70">收藏时间</td>
                                <td>操作</td>
                            </tr>
                            <c:forEach items="${keepModel.list}" var="keepList">
	                            <tr>
	                                <td ><a href="#">${keepList.id}</a></td>
	                                <td>
	                                	<c:if test="${keepList.receiveOwnerType=='att'}"><a href="scenic.htm?id=${keepList.receiveOwner}" target="_blank">${keepList.ownerName}</a></c:if>
	                                	<c:if test="${keepList.receiveOwnerType=='hotel'}"><a href="hotel.htm?id=${keepList.receiveOwner}" target="_blank">${keepList.ownerName}</a></c:if>
	                                	<c:if test="${keepList.receiveOwnerType=='product'}"><a href="product.htm?id=${keepList.receiveOwner}" target="_blank">${keepList.ownerName}</a></c:if>
	                                </td>
	                                <td>
	                                
	                                	<span class="farial clrf60">
	                                	<c:if test="${keepList.receiveOwnerType=='att'}">景点</c:if>
	                                	<c:if test="${keepList.receiveOwnerType=='hotel'}">酒店</c:if>
	                                		<c:if test="${keepList.receiveOwnerType=='product'}">商品</c:if>
	                                	</span>
	                                
	                                </td>
	                                <td><fmt:formatDate value="${keepList.gmtCreated}" pattern="MM-dd HH:mm" /></td>
	                                <td> <a href="javascript:;" class="btn cancel_btn" onclick="cancelMykeep('${keepList.id}')"><span>取消收藏</span></a></td>
	                            </tr>
                            </c:forEach>
                        </table>
                              <c:if test="${keepModel.totalPage>1 }"><div id="page" class="h_page"></div></c:if>
                    </div>
                    <!-- order--end-->
                </div>
            </div>
        </div>
    </div>
      <!-- help-->
         <div class="w980 mg box_style1">
        	<c:forEach items="${help }" var="c">
        		${c.content}
        	</c:forEach>
        </div>
        <!-- help--end-->
        
    <!-- content--end-->
	    <!-- foot-->
	    <%@include file="../common/footer.jsp" %>
	    <!-- foot--end-->
   
        <script type="text/javascript">
$(function(){
	$("#page").pager({
    	pagenumber : '${keepModel.currentPage}',
    	pagecount : '${keepModel.totalPage}',
    	buttonClickCallback : function(page) {
    		window.location.href = "myKeep.htm?page="+page;
    	}
    });
});

	function cancelMykeep(id){
		if(confirm("你确定要取消该收藏吗？")){
				$.post("cancelMykeep.htm",{
					"id":id
				}, function(data) {
					if (data == 'success') {
						alert("取消成功！");
						window.location.href = "myKeep.htm";
					} 
					if(data == 'error'){
						alert("取消失败！");
					}
				});
		}
	}
</script>
</body>
</html>